﻿<UserControl x:Class="Topics.Radical.Presentation.Commanding.AutoCommandBindingWithTemplatesView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:command="http://schemas.topics.it/wpf/radical/windows/markup"
	  mc:Ignorable="d" 
	  d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal">
            <TextBlock Text="InvokedOn: " />
            <TextBlock Text="{Binding Path=InvokedOn}" />
        </StackPanel>

        <TabControl ItemsSource="{Binding Path=Children}" Grid.Row="1" SelectedIndex="0" HorizontalAlignment="Stretch" Margin="0" VerticalAlignment="Stretch">

            <TabControl.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Path=Id}" />
                </DataTemplate>
            </TabControl.ItemTemplate>

            <TabControl.ContentTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" Margin="10,10,0,0">
                        <CheckBox Content="Is Active" IsChecked="{Binding Path=IsDoActive}" Margin="5" />
                        <Button Command="{command:AutoCommandBinding Path=Do}" Content="Do..." Width="70" Height="23" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5" />
                        <TextBlock Text="{Binding Path=Status}" />
                    </StackPanel>
                </DataTemplate>
            </TabControl.ContentTemplate>

        </TabControl>
    </Grid>
</UserControl>
